<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('终端达标返现奖励列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                达标类型：
                                <select name="dbType">
                                    <option value="">所有</option>
                                    <option value="1">首刷(100元返现)</option>
                                    <option value="2">1-30天达标</option>
                                    <option value="3">31-60天达标</option>
                                    <option value="4">61-90天达标</option>
                                </select>
                            </li>
                            <li>
                                版本类型：
                                <select name="type">
                                    <option value="">所有</option>
                                    <option value="1">盟主版</option>
                                    <option value="2">展业端管理版</option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('CkPosReturn:CkPosReturn:edit')}]];
        var removeFlag = [[${@permission.hasPermi('CkPosReturn:CkPosReturn:remove')}]];
        var prefix = ctx + "CkPosReturn/CkPosReturn";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "终端达标返现奖励",
                clickToSelect:true,
                columns: [{
                    checkbox: true
                },
                {
                    field: 'productName',
                    title: '产品名称'
                },
                {
                    field: 'toolsPrice',
                    title: '机具价格(100元/台)'
                },
                {
                    field: 'fxMoney',
                    title: '返现金额'
                },
                {
                    field: 'dbType',
                    title: '达标类型',
                    formatter(value,row,index){
                        if (value == "1"){
                            return "首刷(100元返现)";
                        } else if (value == "2"){
                            return "1-30天达标";
                        } else if (value == "3"){
                            return "31-60天达标";
                        } else if (value == "4"){
                            return "61-90天达标";
                        }
                    }
                },
                {
                    field: 'addMan',
                    title: '添加人'
                },
                {
                    field: 'addDate',
                    title: '添加时间'
                },
                {
                    field: 'type',
                    title: '版本类型',
                    formatter(value,row,index){
                        if (value == "1"){
                            return "盟主版";
                        } else if (value == "2"){
                            return "展业端管理版";
                        }
                    }
                }]
            };
            $.table.init(options);
        });

        /* 添加用户-选择用户-提交 */
        function submitHandler(index, layero) {
            var rows = $.table.selectFirstColumns();
            if (rows.length == 0) {
                $.modal.alertWarning("请至少选择一条记录");
                return;
            }
            $.modal.close();
            alert(JSON.stringify(rows))
            // 父页面的方法
            // parent.selectUsers();
            // 父页面的变量
            parent.$('#note').html(rows.join());
        }
    </script>
</body>
</html>